package com.jchen.auth.service.impl;

import com.jchen.auth.mapper.SysUserMapper;
import com.jchen.auth.service.SysUserService;
import com.jchen.common.entity.UserInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Description
 * @Author jchen
 * @Date 2023/12/11 11:23
 */
@Service
public class SysUserServiceImpl implements SysUserService{

    @Autowired
    private SysUserMapper sysUserMapper;


    @Override
    public UserInfo getByUsername(String name) {
        UserInfo userInfoQuery = new UserInfo();
        userInfoQuery.setUsername(name);
        UserInfo userInfo = sysUserMapper.selectOne(userInfoQuery);
        return userInfo;
    }

    @Override
    public UserInfo getByUserId(Integer userId) {
        return sysUserMapper.selectById(userId);
    }
}
